package com.dhecp.project.storage.service.impl;

import com.dhecp.project.storage.domain.HwStorageHistory;
import com.dhecp.project.storage.mapper.HwStorageHistoryMapper;
import com.dhecp.project.storage.service.HwStorageHistoryService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.dhecp.core.constant.DataFiltering;
import com.dhecp.project.system.service.SysDictionaryForFieldService;
import java.util.List;
import java.util.Map;

/**
 * 历史海外仓库存管理(HwStorageHistory表)服务实现类
 *
 * @author fxz
 * @since 2024-02-28 17:49:23
 */
@Service("hwStorageHistoryService")
public class HwStorageHistoryServiceImpl implements HwStorageHistoryService {
    @Autowired
    private HwStorageHistoryMapper hwStorageHistoryMapper;
    
    @Autowired
    private SysDictionaryForFieldService dictionaryForFieldService;
    /**
    * 查询列表数据
    */
    @Override
    public List<HwStorageHistory> queryList(Map<String, Object> params) throws Exception{
        params.put(DataFiltering.TABLE_ALIAS, "t1");	//查询表别名
        params.put(DataFiltering.DATA_SCODE, dictionaryForFieldService.getDataScode(params));	//数据权限查询条件SQL语句
        return this.hwStorageHistoryMapper.select(params);
    }
    
        /**
     * 通过guid查询单条数据
     *
     * @param params 对象
     * @return 实例对象
     */
    @Override
    public HwStorageHistory queryFirstRecord(Map<String, Object> params) throws Exception{
        params.put(DataFiltering.TABLE_ALIAS, "t1");	//查询表别名
        params.put(DataFiltering.DATA_SCODE, dictionaryForFieldService.getDataScode(params));	//数据权限查询条件SQL语句
        return this.hwStorageHistoryMapper.selectFirstRecordByNid(params);
    }
}

